home *** CD-ROM | disk | FTP | other *** search
- {*************************************************}
- {* QuickReport for Delphi *}
- {* Demo Report LabelRep *}
- {* *}
- {* Shows how to create mailing label type *}
- {* reports. Also show a technic to surpress *}
- {* blank address lines *}
- {*************************************************}
-
- unit Labelrep;
-
- interface
-
- uses
- SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, Quickrep, ExtCtrls, DB, DBTables;
-
- type
- TLabelForm = class(TForm)
- Rep: TQuickReport;
- QRBand1: TQRBand;
- QRDBText1: TQRDBText;
- QRDBText2: TQRDBText;
- QRBand2: TQRBand;
- QRLabel1: TQRLabel;
- QRSysData1: TQRSysData;
- Addr1Label: TQRLabel;
- Addr2Label: TQRLabel;
- QRBand3: TQRBand;
- QRLabel2: TQRLabel;
- QRLabel3: TQRLabel;
- Memo1: TMemo;
- procedure QRBand1BeforePrint(var PrintBand: Boolean);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- LabelForm: TLabelForm;
-
- implementation
-
- uses datasets;
-
- {$R *.DFM}
-
- procedure TLabelForm.QRBand1BeforePrint(var PrintBand: Boolean);
- begin
- with CustomerData do begin
- Addr1Label.Caption:=CustomersCity.Value+' '+CustomersZip.Value+' '+CustomersState.Value;
- if CustomersAddr2.Value<>'' then begin
- Addr2Label.Caption:=Addr1Label.Caption;
- Addr1Label.Caption:=CustomersAddr2.value;
- end else Addr2Label.Caption:='';
- end;
-
- end;
-
- end.
-